﻿<div ng-controller="featureController">
	<div class="wrapper border-bottom white-bg page-heading">
		<div class="col-lg-pull-12">
			<ol class="breadcrumb">
				<li><a ui-sref="app.manage.feature({type:model.type})">{{model.type==1?"后台功能":"店铺功能"}}</a></li>
				<li class="active" ng-bind="breadcrumb"></li>
			</ol>
		</div>
	</div>
	<form name="_form" class="form-horizontal w5c-form" w5c-form-validate="model.validateOptions" novalidate role="form">
		<div class="form-group">
			<label class="col-sm-2 control-label">名称</label>
			<div class="col-sm-10">
				<input name="name" type="text" class="form-control input-sm" ng-model="model.name" required ng-minlength="1" ng-maxlength="15">
			</div>
		</div>
		<!--<div class="form-group">
			<label class="col-sm-2 control-label">类型</label>
			<div class="col-sm-10">
				<select name="type" class="form-control input-sm" ng-model="model.type" required>
					<option value="1" ng-selected="model.type==1">后台</option>
					<option value="2" ng-selected="model.type==2">店铺</option>
				</select>
			</div>
		</div>-->
		<div class="form-group">
			<label class="col-sm-2 control-label">上级</label>
			<div class="col-sm-10">
				<ui-select ng-model="model.parent_id" theme="bootstrap">
					<ui-select-match placeholder="选择上级">{{$select.selected.name}}</ui-select-match>
					<ui-select-choices repeat="item.id as item in list | propsFilter: {name: $select.search}">
						<div><span ng-if="item.parent_id!=0" style="padding-left:{{20*(item.depth-1)}}px;"></span> {{item.name}}</div>
					</ui-select-choices>
				</ui-select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">备注</label>
			<div class="col-sm-10">
				<textarea name="remark" class="form-control input-sm" ng-model="model.remark"></textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">链接地址</label>
			<div class="col-sm-10">
				<input name="url" type="text" class="form-control input-sm" ng-model="model.url">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">跳转链接</label>
			<div class="col-sm-10">
				<input name="goto_url" type="text" class="form-control input-sm" ng-model="model.goto_url">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">图标</label>
			<div class="col-sm-10">
				<input name="icon" type="text" class="form-control input-sm" ng-model="model.icon">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">排序</label>
			<div class="col-sm-10">
				<input name="sort" type="number" class="form-control input-sm" ng-model="model.sort" required pattern="^(\d+)*$">
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" w5c-form-submit="save()" class="btn btn-primary btn-sm" btn-loading="psdisabled" loading-text="保存中..." ng-disabled="psdisabled">
					<i class="fa fa-save"></i> 保存
				</button>
				<button ng-click="goBack()" class="btn btn-primary btn-sm"><i class="fa fa-rotate-left"></i> 取消</button>
			</div>
		</div>
	</form>
</div>